var t,
  a = require("../../@babel/runtime/helpers/defineProperty"),
  i = require("../../res/www.a9a.cn.js"),
  n = getApp(),
  o = 2,
  e = !0;
Page({
  data: {
    nTitle: "群成员",
    t: 0,
    triggered: !0,
    loading_flag: !1,
    loading_ico_flag: !1,
    loading_str: "玩命加载中",
  },
  onLoad: function (t) {
    var a = this;
    a.setData({ qid: t.qid }),
      wx.setNavigationBarTitle({ title: a.data.nTitle }),
      n.get_config("_ZEAI").then(function (t) {
        a.setData({ color: n._ZEAI.color, rgbcolor: i.c16_rgb(n._ZEAI.color) });
      }),
      n.get_navigationBarTopHeight(a),
      a.init();
  },
  init: function () {
    var o = this;
    i.ifint(this.data.qid) ||
      wx.showModal({
        content: "参数跑路了",
        confirmColor: o.data.color,
        confirmText: "朕知道了",
        showCancel: !1,
        success: function (t) {
          wx.navigateBack();
        },
      }),
      wx.showLoading({ title: "玩命加载中...", mask: !0 }),
      (e = !1),
      (t = wx.getStorageSync("COOK_U")),
      n.ajax({
        url: "qun.php",
        data: { submitok: "qun_ulist", openid: t.openid, qid: o.data.qid },
        success: function (t) {
          var i;
          1 == t.flag
            ? 0 == t.LIST.length
              ? o.setData({
                  LIST: [],
                  ulist_nodata: !0,
                  nTitle: t.nTitle,
                  LIST_QZ: t.LIST_QZ,
                  ifqz: t.ifqz,
                })
              : o.setData(
                  (a((i = {}), "LIST[0]", t.LIST),
                  a(i, "nTitle", t.nTitle),
                  a(i, "LIST_QZ", t.LIST_QZ),
                  a(i, "ifqz", t.ifqz),
                  i)
                )
            : wx.showToast({ title: t.msg, icon: "none", mask: !0 });
          (e = !0), wx.hideLoading();
        },
      });
  },
  tFn: function (t) {
    var a = t.currentTarget.dataset.t;
    this.setData({
      triggered: !1,
      loading_flag: !1,
      loading_str: "拼命加载中",
      LIST: [],
      ulist_nodata: !1,
      t: a,
    }),
      this.init();
  },
  delFn: function (a) {
    var i = this,
      o = a.currentTarget.dataset.uid2;
    (t = wx.getStorageSync("COOK_U")),
      wx.showModal({
        title: "",
        content: "确定要删除么？",
        confirmColor: i.data.color,
        cancelText: "取消",
        confirmText: "确定",
        success: function (a) {
          a.confirm &&
            n.ajax({
              url: "qun.php",
              data: {
                submitok: "delulist",
                uid2: o,
                qid: i.data.qid,
                openid: t.openid,
              },
              success: function (t) {
                if (1 == t.flag) {
                  var a = { qid: i.data.qid };
                  i.onLoad(a);
                } else wx.showToast({ title: t.msg, icon: "none", mask: !0 });
              },
            });
        },
      });
  },
  nodatabackFn: function () {
    this.setData({
      triggered: !1,
      loading_flag: !1,
      loading_str: "拼命加载中",
      LIST: [],
      ulist_nodata: !1,
      t: 0,
    }),
      this.init();
  },
  onPullDownRefresh: function () {
    var t = this;
    wx.vibrateShort({ type: "heavy" }),
      setTimeout(function () {
        t.setData({
          triggered: !1,
          loading_flag: !1,
          loading_str: "拼命加载中",
          LIST: [],
          ulist_nodata: !1,
          t: 0,
        }),
          t.setloading("end", "拼命加载中"),
          (o = 2),
          t.init();
      }, 500);
  },
  setloading: function (t, a) {
    "start" == t
      ? this.setData({ loading_flag: !0, loading_ico_flag: !0, loading_str: a })
      : this.setData({
          loading_flag: !1,
          loading_ico_flag: !1,
          loading_str: a,
        });
  },
  onReachBottom: function () {
    var i = this.data.LIST,
      s = this;
    if (e) {
      (e = !1), s.setloading("start", "拼命加载中");
      var l = {
        submitok: "qun_ulist",
        p: o,
        openid: t.openid,
        qid: s.data.qid,
      };
      n.ajax({
        url: "qun.php",
        data: l,
        success: function (t) {
          if (1 == t.flag) {
            var n = i.length;
            if (t.LIST.length < 1)
              return s.setloading("end", "已全部加载完毕"), void (e = !1);
            s.setData(a({}, "LIST[" + n + "]", t.LIST)), (o += 1), (e = !0);
          } else wx.showToast({ title: t.msg, icon: "none", mask: !0 });
          s.setloading("end", "上拉加载更多");
        },
      });
    }
  },
  binnd_scroll: function (t) {
    t.detail.scrollTop > 100
      ? this.setData({ backtop_flag: !0 })
      : this.setData({ backtop_flag: !1 });
  },
  backtopFn: function (t) {
    var i = "scrolltopNum_" + t.currentTarget.dataset.id;
    this.setData(a({}, i, 0));
  },
});
